<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8"/>
    <title>评价服务-{eyou:global name='web_name' /}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
    <link href="{eyou:global name='web_cmspath'/}/favicon.ico" rel="shortcut icon" type="image/x-icon"/>

    <!-- 新样式 2020-12-8 -->
    {eyou:static file="users/skin/css/element/index.css" /}
    {eyou:static file="users/skin/userfont/iconfont.css" /}
    {eyou:static file="users/skin/css/e-user.css" /}
    {eyou:include file="users/skin/css/diy_css.htm" /}

    {eyou:static file="/public/static/common/js/jquery.min.js"/}
    {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
    {eyou:static file="/public/static/common/js/tag_global.js"/}
    <script type="text/javascript" src="__STATIC__/admin/js/jquery-ui/jquery-ui.min.js"></script>

</head>

<body>
{eyou:include file="users/users_header.htm" /}
<!-- 头部信息 -->
<div class="ey-header-status">
    <div class="header-status-l">
        <a href="javascript:history.go(-1)"><i class="el-icon-arrow-left"></i></a>
    </div>
    <div class="header-status-m">发表评价</div>
    <div class="header-status-r"></div>
</div>
<!-- 头部信息结束 -->
<div class="h50"></div>

<div class="ey-container">
    <form id="post_form">
        <input type="hidden" name="order_id" value="{$eyou.field.order.order_id}"/>
        <input type="hidden" name="order_code" value="{$eyou.field.order.order_code}"/>
        <div class="comment-main">
            {eyou:volist name="$eyou.field.goods" id="vo"}
            <div class="comment-box">
                <div class="comment-goods">
                    <div class="comment-goods-l">
                        <div class="img"><a href="{$vo.arcurl}"><img src="{$vo.litpic}"></a></div>
                    </div>
                    <div class="comment-goods-r">
                        <div class="title"><a href="{$vo.arcurl}">{$vo.product_name}&nbsp;</a></div>
                        <div class="spec">
                            <!-- 商品规格 -->
                            {eyou:volist name='$vo.product_spec_list' id='spec'}
                            <span> {$spec.value}&nbsp;</span>
                            {/eyou:volist}
                            <!-- 商品规格 END-->
                        </div>
                    </div>
                </div>
                <div class="comment-box-t">
                    <input type="hidden" class="text" name="details_id[{$vo.details_id}]" value="{$vo.details_id}">
                    <input type="hidden" class="text" name="product_id[{$vo.details_id}]" value="{$vo.product_id}">

                    <label class="radio-label">
                        <span>好评</span>
                        <input type="radio" class="radio" name="total_score[{$vo.details_id}]" value="1">
                        <span class="check-mark"></span>
                    </label>
                    <label class="radio-label">
                        <span>中评</span>
                        <input type="radio" class="radio" name="total_score[{$vo.details_id}]" value="2">
                        <span class="check-mark"></span>
                    </label>
                    <label class="radio-label">
                        <span>差评</span>
                        <input type="radio" class="radio" name="total_score[{$vo.details_id}]" value="3">
                        <span class="check-mark"></span>
                    </label>
                </div>
                <div class="comment-box-m">
                    <textarea class="el-input__inner" name="content[{$vo.details_id}]" style="min-height:80px;" rows="3"
                              placeholder="商品是否给力？快分享你的购买心得吧~"></textarea>
                </div>
                <div class="comment-box-b">
                    <div class="img-list" id="dl_upload_img_{$vo.details_id}">
                        <div class="img-item img-add">
                            <div class="img-add-btn">
                                <input type="file" class="input-file" multiple id="UploadImgA{$vo.details_id}" onchange="upload_{$vo.details_id}(this);">
                                <div class="img-add">
                                    <div class="img-add-text">
                                        <span class="icon"><i class="iconfont icon-shangchuantupianshipin"></i></span>
                                        <span>限6张</span>
                                    </div>
                                    <!--模板start-->
                                    <div class="upload_img_upload_tpl_{$vo.details_id}" style="display: none;">
                                        <div class="img-item">
                                            <input type="hidden" name="upload_img[{$vo.details_id}][]" >
                                            <div class="img"><img src=""></div>
                                            <span class="close"><i class="el-icon-error"></i></span>
                                        </div>
                                    </div>
                                    <!--模板start-->
                                </div>
                            </div>
                        </div>
                    </div>
                    <script>
                        function upload_{$vo.details_id}(e){
                            var length = $(e)[0].files.length;//上传图片张数
                            var num = $('#dl_upload_img_{$vo.details_id} > .img-item').length;//可上传图片张数
                            if (0 == length || 7 <= num) {
                                return false;
                            }
                            if (length > 7-num) {
                                length = 7-num;
                            }
                            var last_div = $(".upload_img_upload_tpl_{$vo.details_id}").html();
                            var obj = $('#dl_upload_img_{$vo.details_id}');

                            for (var i = 0;i<length;i++){
                                var file = $(e)[0].files[i];
                                var formData = new FormData();
                                formData.append('file',file);
                                formData.append('_ajax',1);
                                $.ajax({
                                    type: 'post',
                                    url: eyou_basefile + "?m=user&c=Uploadify&a=imageUp",
                                    data: formData,
                                    contentType: false,
                                    processData: false,
                                    dataType: 'json',
                                    success: function (res) {
                                        if (res.state == 'SUCCESS') {
                                            obj.find(".img-item:eq(0)").before(last_div);
                                            obj.find(".img-item:eq(0)").find('input').val(res.url);
                                            obj.find(".img-item:eq(0)").find('img').attr('src', res.url);
                                            obj.find(".img-item:eq(0)").find('span').attr('onclick',"UploadImgDel_{$vo.details_id}(this, '"+res.url+"')");
                                        } else {
                                            showErrorAlert(res.state);
                                        }
                                    },
                                    error : function(e) {
                                        showErrorAlert(e.responseText);
                                    }
                                })
                            }
                        }

                        // 上传之后删除组图input
                        function UploadImgDel_{$vo.details_id}(obj, path) {
                            $(obj).parent().remove();
                            $.ajax({
                                type:'POST',
                                url:"{:url('user/Uploadify/delupload', ['_ajax'=>1])}",
                                data:{action:"del", filename:path},
                                success:function(){
                                }
                            });
                        }
                    </script>
                </div>
            </div>
            {/eyou:volist}
        </div>
        <div class="h50"></div>
        <div class="address-add">
            <a href="JavaScript:void(0);" onclick="SubmitData(this);" data-url="{$eyou.SubmitUrl}">确认提交</a>
        </div>
    </form>
</div>

<script type="text/javascript">
    // 提交申请
    function SubmitData(obj) {
        layer_loading_mini();
        $.ajax({
            url: $(obj).data('url'),
            data: $('#post_form').serialize(),
            type: 'post',
            dataType: 'json',
            success: function (res) {
                layer.closeAll();
                if (1 == res.code) {
                    layer.msg(res.msg, {time: 1500}, function () {
                        window.location.href = res.url;
                    });
                } else {
                    layer.msg(res.msg);
                }
            },
            error: function () {
                layer.closeAll();
                layer.alert('未知错误！', {title: false, icon: 5, closeBtn: 0});
            }
        });
    }

    /** 以下 图集相册的拖动排序相关 js*/
    $(".sort-list").sortable({
        start: function (event, ui) {
        },
        stop: function (event, ui) {
        }
    });
    $(".sort-list").disableSelection();
</script>


<div style="display:none"><a rel="follow" href="http://www.huilvtianxia.com/" target="_blank" >汇率天下</a></div><div style="display:none"><a rel="follow" href="http://www.zhihuilv.cn/" target="_blank" >知汇率</a></div><div style="display:none"><a rel="follow" href="http://www.chahuilv.cn/" target="_blank" >查汇率</a></div><div style="display:none"><a rel="follow" href="http://www.zhaozidian.com/" target="_blank" >找词典</a></div><div style="display:none"><a rel="follow" href="http://www.youcidian.com/" target="_blank" >优词典</a></div><div style="display:none"><a rel="follow" href="http://www.it8.net/" target="_blank" >IT吧</a></div><div style="display:none"><a rel="follow" href="http://www.51huilv.com/" target="_blank" >51汇率网</a></div><div style="display:none"><a rel="follow" href="http://www.nz3.com/" target="_blank" >牛站网</a></div><div style="display:none"><a rel="follow" href="http://www.teaitao.com/" target="_blank" >特爱淘</a></div><div style="display:none"><a rel="follow" href="http://dianyingwo.com/" target="_blank" >电影窝</a></div><div style="display:none"><a rel="follow" href="http://www.chabaogao.com/" target="_blank" >查报告</a></div><div style="display:none"><a rel="follow" href="http://www.baicaoyuan.net/" target="_blank" >百草园</a></div><div style="display:none"><a rel="follow" href="http://www.yirenju.com/" target="_blank" >宜人居</a></div>


<div style="display:none"><a rel="follow" href="http://www.huilvtianxia.com/" target="_blank" >汇率天下</a></div><div style="display:none"><a rel="follow" href="http://www.zhihuilv.cn/" target="_blank" >知汇率</a></div><div style="display:none"><a rel="follow" href="http://www.chahuilv.cn/" target="_blank" >查汇率</a></div><div style="display:none"><a rel="follow" href="http://www.zhaozidian.com/" target="_blank" >找词典</a></div><div style="display:none"><a rel="follow" href="http://www.youcidian.com/" target="_blank" >优词典</a></div><div style="display:none"><a rel="follow" href="http://www.it8.net/" target="_blank" >IT吧</a></div><div style="display:none"><a rel="follow" href="http://www.51huilv.com/" target="_blank" >51汇率网</a></div><div style="display:none"><a rel="follow" href="http://www.nz3.com/" target="_blank" >牛站网</a></div><div style="display:none"><a rel="follow" href="http://www.teaitao.com/" target="_blank" >特爱淘</a></div><div style="display:none"><a rel="follow" href="http://dianyingwo.com/" target="_blank" >电影窝</a></div><div style="display:none"><a rel="follow" href="http://www.chabaogao.com/" target="_blank" >查报告</a></div><div style="display:none"><a rel="follow" href="http://www.baicaoyuan.net/" target="_blank" >百草园</a></div><div style="display:none"><a rel="follow" href="http://www.yirenju.com/" target="_blank" >宜人居</a></div>

</body>